home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / DBio / DSeqMail.cpp < prev    next >
Text File  |  1996-07-05  |  45KB  |  1,708 lines

  1. // DSeqMail.cpp
  2. // d.g.gilbert
  3.  
  4.  
  5. #include <ncbi.h>
  6. #include <dgg.h>
  7. #include <DControl.h>
  8. #include <DPanel.h>
  9. #include <DTCP.h>
  10. #include <DSMTPclient.h>
  11. #include <DUtil.h>
  12. #include <DFile.h>
  13. #include <DSendMailDialog.h>
  14. #include <DSequence.h>
  15. #include <DSeqFile.h>
  16. #include <DApplication.h>
  17.  
  18. #include "DSeqMail.h"
  19.  
  20.  
  21. Local Nlm_FonT  gNoteFont = NULL;
  22. #define SETNOTEFONT()    if (!gNoteFont)    gNoteFont= Nlm_ParseFont("Times,9");
  23.  
  24. class DOptWindow : public DWindow
  25. {
  26. public:
  27.     DOptWindow(DView* superior, char* title) : 
  28.         DWindow(0, superior, DWindow::fixed, -5,  -5, -60, -30, title, kDontFreeOnClose) 
  29.             {}
  30.     void CloseAndFree() { this->Close(); }
  31. };
  32.  
  33.  
  34.  
  35. // class DNCBIBlast
  36.  
  37.  
  38. char* DNCBIBlast::kAddress = "blast@ncbi.nlm.nih.gov";
  39. char* DNCBIBlast::kTitle = "BLAST Search at NCBI";
  40. #ifdef OS_DOS
  41.   char* DNCBIBlast::kHelp     = "ncbi-bl.hel";     
  42. #else
  43.   char* DNCBIBlast::kHelp     = "ncbi-blast.help";     
  44. #endif                                                                     
  45.             
  46.                                                                                 
  47. DNCBIBlast::DNCBIBlast( long id, DTaskMaster* itsSuperior, DSequence* theSeq) :
  48.     DSendMailDialog(id, itsSuperior,    -5,  -5,  -50,  -20, kTitle),
  49.     fOptionWin(NULL)
  50. {
  51.     fSeq= (DSequence*) theSeq->Clone();
  52. }
  53.  
  54. DNCBIBlast::~DNCBIBlast()
  55. {
  56.     if (fOptionWin) delete fOptionWin; // !? is this handled by DView::DeleteSubviews() ???!!!
  57.     delete fSeq;
  58. }
  59.  
  60. char* DNCBIBlast::BuildMessage()
  61. {
  62.     enum blastMethod { blastp, tblastn, blastn, blastx } meth;
  63.     char        buf[512], name[128], *cp;
  64.     short         item;
  65.     DPopupList *pmeth, *plib;
  66.     char        *msg = NULL;
  67.     Boolean isamino= fBaseKind->GetValue() == 2;
  68.     
  69.             // want IOSTREAMS here !!!!!!!!!!!!!!!!!!!! not damn sprintf's
  70.     DTempFile* qfile = new DTempFile();
  71.  
  72.     pmeth= (isamino) ? fAmeth : fNmeth;
  73.     pmeth->GetSelectedItem(item,name,128);
  74.     cp= StrChr( name, ' '); if (cp) *cp= 0;
  75.     sprintf( buf, "PROGRAM %s\n", name); qfile->WriteLine(buf);
  76.     
  77.     if (StringCmp(name,"blastp") == 0) meth= blastp;
  78.     else if (StringCmp(name,"blastx") == 0) meth= blastx;
  79.     else if (StringCmp(name,"tblastn") == 0) meth= tblastn;
  80.     else meth= blastn;
  81.      
  82.     if (meth == blastp || meth == blastx) plib= fAlib;
  83.     else plib= fNlib;
  84.     plib->GetSelectedItem(item,name,128);
  85.     cp= StrChr( name, ' '); if (cp) *cp= 0;
  86.     sprintf( buf, "DATALIB %s\n", name);    qfile->WriteLine(buf);
  87.  
  88.     if (fOptionWin) {
  89.         fDesc->GetTitle(name,128); 
  90.         sprintf( buf, "DESCRIPTION %s\n", name); qfile->WriteLine(buf);
  91.         
  92.         fAlign->GetTitle(name,128); 
  93.         sprintf( buf, "ALIGNMENTS %s\n", name);  qfile->WriteLine(buf);
  94.     
  95.         fExpect->GetTitle(name,128); 
  96.         if (*name) { sprintf( buf, "EXPECT %s\n", name);    qfile->WriteLine(buf); }
  97.     
  98.         fCutoff->GetTitle(name,128); 
  99.         if (*name) { sprintf( buf, "CUTOFF %s\n", name);    qfile->WriteLine(buf); }
  100.     
  101.         if (meth != blastn) {
  102.             fMatrix->GetSelectedItem(item,name,128);
  103.             cp= StrChr( name, ' '); if (cp) *cp= 0;
  104.             sprintf( buf, "MATRIX %s\n", name);    qfile->WriteLine(buf);
  105.             }
  106.     
  107.         if (meth != blastn) {
  108.             fStrand->GetSelectedItem(item,name,128);
  109.             if (item > 1) {
  110.                 cp= StrChr( name, ' '); if (cp) *cp= 0;
  111.                 sprintf( buf, "STRAND %s\n", name);    qfile->WriteLine(buf);
  112.                 }
  113.             }
  114.     
  115.         fFilter->GetSelectedItem(item,name,128);
  116.         if (item > 1) {
  117.             cp= StrChr( name, ' '); if (cp) *cp= 0;
  118.             sprintf( buf, "FILTER %s\n", name);    qfile->WriteLine(buf);
  119.             }
  120.             
  121.         if (fHistogram->GetStatus() && meth != blastx) { 
  122.             sprintf( buf, "HISTOGRAM yes\n");    qfile->WriteLine(buf); 
  123.             }
  124.         }
  125.         
  126.     sprintf( buf, "BEGIN\n", name);    qfile->WriteLine(buf);
  127.     
  128.         //!! must use bases from fMsg text
  129.     msg= fMsg->GetText();
  130.     fSeq->SetBases( msg);
  131.     MemFree(msg);
  132.     DSeqFile::DontSaveMasks();
  133.     fSeq->DoWrite( qfile, DSeqFile::kPearson); 
  134.     DSeqFile::DoSaveMasks();
  135.     ulong msgbytes;
  136.     msg= qfile->ReadIntoMemory( msgbytes);
  137.     delete qfile;
  138.  
  139.     return msg;
  140. }
  141.  
  142.  
  143.  
  144. Boolean DNCBIBlast::IsMyAction(DTaskMaster* action) 
  145. {    
  146.     switch(action->Id()) {
  147.  
  148.         case cProtMeth:
  149.             if (fAmeth->GetValue() == 1) {
  150.                 fNlib->Disable();
  151.                 fAlib->Enable();
  152.                 }
  153.             else {
  154.                 fAlib->Disable();
  155.                 fNlib->Enable();
  156.                 }
  157.             return true;
  158.  
  159.         case cNucMeth:
  160.             if (fNmeth->GetValue() == 2) {
  161.                 fNlib->Disable();
  162.                 fAlib->Enable();
  163.                 }
  164.             else {
  165.                 fAlib->Disable();
  166.                 fNlib->Enable();
  167.                 }
  168.             return true;
  169.             
  170.         case cBaseKind:
  171.             if (fBaseKind->GetValue() == 2) {
  172.                 fNmeth->Hide();
  173.                 fAmeth->Show();
  174.                 }
  175.             else {
  176.                 fAmeth->Hide();
  177.                 fNmeth->Show();
  178.                 }
  179.             return true;
  180.             
  181.         case cOptions:
  182.             if (!fOptionWin) Options(); // build window
  183.             if ( fOptionWin) fOptionWin->Open();
  184.             return true;
  185.             
  186.         case cHelpButton:
  187.             gApplication->OpenHelp(kHelp);
  188.             return true;            
  189.          
  190.         default:
  191.             return DSendMailDialog::IsMyAction(action);    
  192.         }
  193. }
  194.  
  195.  
  196.  
  197.  
  198. void DNCBIBlast::Options()
  199. {
  200.     fOptionWin= new DOptWindow(this,"Blast Options");
  201.     DView* super = fOptionWin;
  202.  
  203.             // this needs to be a subsidiary window...
  204.     //DCluster* clu= new DCluster(0,super,0,0,false,"Options");
  205.     //super= clu;
  206.     
  207.     (void) new DPrompt(0, super, "Max. descriptions of matching seqs");
  208.     super->NextSubviewToRight();
  209.     fDesc= new DEditText(0,super,"100",6);
  210.     super->NextSubviewBelowLeft();
  211.     
  212.     (void) new DPrompt(0, super, "Max. alignments of high scoring pairs");
  213.     super->NextSubviewToRight();
  214.     fAlign= new DEditText(0,super,"50",6);
  215.     super->NextSubviewBelowLeft();
  216.  
  217.     (void) new DPrompt(0, super, "Expectation cutoff (real number)");
  218.     super->NextSubviewToRight();
  219.     fExpect= new DEditText(0,super,NULL,6);
  220.     super->NextSubviewBelowLeft();
  221.  
  222.     (void) new DPrompt(0, super, "Cutoff score from expectation (integer)");
  223.     super->NextSubviewToRight();
  224.     fCutoff= new DEditText(0,super,NULL,6);
  225.     super->NextSubviewBelowLeft();
  226.  
  227.     fHistogram= new DCheckBox(0,super,"Show Histogram");
  228.     super->NextSubviewBelowLeft();
  229.     
  230.     (void) new DPrompt(0, super, "Subsitition matrix");
  231.     super->NextSubviewToRight();
  232.     fMatrix= new DPopupList( cMatrix, super);
  233.     fMatrix->AddItem("blosum62");
  234.     fMatrix->AddItem("pam40");
  235.     fMatrix->AddItem("pam120");
  236.     fMatrix->AddItem("pam250");
  237.     fMatrix->SetValue(1);
  238.     super->NextSubviewBelowLeft();
  239.     
  240.     (void) new DPrompt(0, super, "Strand");
  241.     super->NextSubviewToRight();
  242.     fStrand= new DPopupList( cStrand, super);
  243.     fStrand->AddItem("both");
  244.     fStrand->AddItem("top | plus | +");
  245.     fStrand->AddItem("bottom | minus | -");
  246.     fStrand->SetValue(1);
  247.     super->NextSubviewBelowLeft();
  248.     
  249.     (void) new DPrompt(0, super, "Filter junk");
  250.     super->NextSubviewToRight();
  251.     fFilter= new DPopupList( cFilter, super);
  252.     fFilter->AddItem(" no filtering");
  253.     fFilter->AddItem("SEG - mask out low compositional complexity");
  254.     fFilter->AddItem("XNU - mask out short-periodicity internal repeats");
  255.     fFilter->AddItem("SEG+XNU - filter SEG then XNU");
  256.     fFilter->AddItem("XNU+SEG - filter XNU then SEG");
  257.     fFilter->SetValue(1);
  258.     super->NextSubviewBelowLeft();
  259.  
  260. }
  261.  
  262.  
  263.  
  264. void DNCBIBlast::Open()
  265. {
  266.     DView* super = this;
  267.     DCluster* clu;
  268.  
  269.     char *shorthelp1= 
  270. "The BLAST algorithm is a heuristic for finding ungapped,"LINEEND
  271. "locally optimal sequence alignments.";
  272.     SETNOTEFONT();
  273.     (void) new DNotePanel(0,super,shorthelp1, 25*Nlm_stdCharWidth,0,gNoteFont);
  274.     
  275.     super->NextSubviewBelowLeft();
  276.  
  277.     DView *eto  = this->InstallTo(super, kAddress);
  278.     DView *efrom= this->InstallFrom(super);  // don't have to display this one
  279.     DView *esubj= NULL; 
  280.     DView *eccopy= NULL;
  281.  
  282.     clu= new DCluster(0,super,0,0,true,"");
  283.     super= clu;
  284.     
  285.     fBaseKind= new DCluster(cBaseKind,super,0,0,false,"Bases are");
  286.     super= fBaseKind;
  287.     (void) new DRadioButton(0,super,"Nucleic");
  288.     super->NextSubviewToRight();
  289.     (void) new DRadioButton(0,super,"Amino");
  290.     if (fSeq->IsAmino()) fBaseKind->SetValue(2); else fBaseKind->SetValue(1);
  291.     
  292.     super= clu;
  293.     
  294.     super->NextSubviewToRight();
  295.     fOptions= new DButton( cOptions, super, "Options");
  296.     fOptions->SetResize( DView::fixed, DView::moveinsuper);
  297.  
  298.     super->NextSubviewBelowLeft();
  299.  
  300.     (void) new DPrompt(0, super, "Search method");
  301.     super->NextSubviewBelowLeft();
  302.     
  303.     fAmeth= new DPopupList( cProtMeth, super);
  304.     fAmeth->AddItem("blastp - amino query vs. protein lib");
  305.     fAmeth->AddItem("tblastn - amino query vs. all frames of nucleic lib");    
  306.     fAmeth->SetValue(1);
  307.  
  308.     fNmeth= new DPopupList( cNucMeth, super);
  309.     fNmeth->AddItem("blastn - nucleic query vs. nucleic lib");
  310.     fNmeth->AddItem("blastx - nucleic in all frames vs. amino lib");    
  311.     fNmeth->SetValue(1);
  312.  
  313.     if (fSeq->IsAmino()) fNmeth->Hide(); else fAmeth->Hide();
  314.     super->NextSubviewBelowLeft();
  315.     
  316. #if 0
  317. // ncbi blast libs as of jun'96
  318.  nr       n Non-redundant GenBank+EMBL+DDBJ+PDB sequences (but no ESTs or STSs)
  319.  est      n Non-redundant Database of GenBank+EMBL+DDBJ EST Division
  320.  sts      n Non-redundant Database of GenBank+EMBL+DDBJ STS Division
  321.  pdb      n PDB nucleotide sequences
  322.  vector   n Vector subset of GenBank
  323.  mito     n Database of mitochondrial sequences, Rel. 1.0, July 1995
  324.  kabat    n Kabat Sequences of Nucleic Acid of Immunological Interest
  325.  epd      n Eukaryotic Promotor Database
  326.  alu      n Select Alu Repeats from REPBASE
  327.  month    n All new/revised GenBank+EMBL+DDBJ+PDB sequences in the last 30 days
  328.  
  329.  nr        p Non-redundant GenBank CDS translations+PDB+SwissProt+PIR
  330.  pdb       p PDB protein sequences
  331.  spdb      p Non-redundant SwissProt+PDB sequences
  332.  kabat     p Kabat Sequences of Proteins of Immunological Interest
  333.  alu       p Translations of Select Alu Repeats from REPBASE
  334.  month     p All new/revised GenBank trans+PDB+SwissProt+PIR in last 30 days
  335.  swissprot p SwissProt sequences
  336. #endif    
  337.  
  338.     (void) new DPrompt(0, super, "Nucleic library");
  339.     super->NextSubviewBelowLeft();
  340.     fNlib= new DPopupList( cNucLib, super);
  341.     fNlib->AddItem("nr - non-redundant nucleic library");
  342.     fNlib->AddItem("month - new/revised sequences in last month");
  343.     fNlib->AddItem("est - non-redundant EST division");
  344.     fNlib->AddItem("sts - non-redundant STS division");
  345.     fNlib->AddItem("pdb - from Brookhaven Protein Data Bank");
  346.     fNlib->AddItem("vector - vector subset of GenBank");
  347.     fNlib->AddItem("mito - mitochondrial sequences");
  348.     fNlib->AddItem("kabat - Kabat immunological sequences");
  349.     fNlib->AddItem("epd - eukaroytic promotors");
  350.     fNlib->AddItem("alu - Alu repeats from REPBASE");
  351.     fNlib->SetValue(1);
  352.     super->NextSubviewBelowLeft();
  353.  
  354.     (void) new DPrompt(0, super, "Protein library");
  355.     super->NextSubviewBelowLeft();
  356.     fAlib= new DPopupList( cProtLib, super);
  357.     fAlib->AddItem("nr - non-redundant protein library");
  358.     fNlib->AddItem("month - new/revised sequences in last month");
  359.     fAlib->AddItem("swissprot - latest full Swiss-Prot");
  360.     fAlib->AddItem("spbd - non-redundant SwissProt+PDB");
  361.     fAlib->AddItem("pdb - from Brookhaven Protein Data Bank");
  362.     fNlib->AddItem("alu - Alu repeats from REPBASE");
  363.     fAlib->AddItem("kabat - Kabat immunological sequences");
  364.     fAlib->SetValue(1);
  365.     super->NextSubviewBelowLeft();
  366.  
  367.     super= this;
  368.     super->NextSubviewBelowLeft();
  369.  
  370.     (void) new DPrompt(0, super, "Your query sequence");
  371.     super->NextSubviewBelowLeft();
  372.     DView *emsg= this->InstallMessage(super, fSeq->Bases());
  373.     
  374.     SetDlogItems( eto, efrom, eccopy, esubj, emsg);
  375.     
  376.     AddOkayCancelButtons(cSEND,"Send");
  377.     
  378.     this->NextSubviewToRight();
  379.     DButton* hb= new DButton( cHelpButton, this, "Help");
  380.     hb->SetResize( DView::fixed, DView::moveinsuper);
  381.     
  382.     DWindow::Open();
  383. }
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390. // class DNCBIFetch
  391.  
  392.  
  393.   char* DNCBIFetch::kAddress = "retrieve@ncbi.nlm.nih.gov";
  394.   char* DNCBIFetch::kTitle = "Fetch from NCBI";
  395.  
  396. #ifdef OS_DOS
  397.   char* DNCBIFetch::kHelp     = "ncbi-ret.hel";     
  398. #else
  399.   char* DNCBIFetch::kHelp     = "ncbi-retrieve.help";     
  400. #endif                                            
  401.                          
  402.                                                                                 
  403. DNCBIFetch::DNCBIFetch( long id, DTaskMaster* itsSuperior) :
  404.     DSendMailDialog(id, itsSuperior,    -5,  -5,  -50,  -20, kTitle)
  405. {
  406. }
  407.  
  408.  
  409. char* DNCBIFetch::BuildMessage()
  410. {
  411.     char        buf[512], name[128], *cp;
  412.     short         item;
  413.     char        *msg = NULL;
  414.     
  415.             // want IOSTREAMS here !!!!!!!!!!!!!!!!!!!! not damn sprintf's
  416.     DTempFile* qfile = new DTempFile();
  417.  
  418.     fLib->GetSelectedItem(item,name,128);
  419.     cp= StrChr( name, ' '); if (cp) *cp= 0;
  420.     sprintf( buf, "DATALIB %s\n", name);    qfile->WriteLine(buf);
  421.  
  422.     fDocs->GetTitle(name,128); 
  423.     sprintf( buf, "MAXDOCS %s\n", name); qfile->WriteLine(buf);
  424.     
  425.     fLines->GetTitle(name,128); 
  426.     sprintf( buf, "MAXLINES %s\n", name);  qfile->WriteLine(buf);
  427.  
  428.     if (fTitles->GetStatus()) { 
  429.         sprintf( buf, "TITLES yes\n");    qfile->WriteLine(buf); 
  430.         }
  431.  
  432.     fStart->GetTitle(name,128); 
  433.     if (*name) { sprintf( buf, "STARTDOC %s\n", name);    qfile->WriteLine(buf); }
  434.         
  435.     sprintf( buf, "BEGIN\n", name);    qfile->WriteLine(buf);
  436.     
  437.     msg= fMsg->GetText();
  438.     qfile->WriteLine(msg);
  439.     MemFree(msg);
  440.     
  441.     ulong msgbytes;
  442.     msg= qfile->ReadIntoMemory( msgbytes);
  443.     delete qfile;
  444.  
  445.     return msg;
  446. }
  447.  
  448.  
  449.  
  450. Boolean DNCBIFetch::IsMyAction(DTaskMaster* action) 
  451. {    
  452.     switch(action->Id()) {
  453.             
  454.         case cHelpButton:
  455.             gApplication->OpenHelp(kHelp);
  456.             return true;            
  457.          
  458.         default:
  459.             return DSendMailDialog::IsMyAction(action);    
  460.         }
  461. }
  462.  
  463.  
  464.  
  465. void DNCBIFetch::Open()
  466. {
  467.     DView* super = this;
  468.  
  469.     char *shorthelp1= 
  470. "NCBI Retrieve server allows you to fetch database entries.";
  471.     SETNOTEFONT();
  472.     (void) new DNotePanel(0,super,shorthelp1, 25*Nlm_stdCharWidth, 0, gNoteFont);
  473.     super->NextSubviewBelowLeft();
  474.  
  475.     DView *eto  = this->InstallTo(super, kAddress);
  476.     DView *efrom= this->InstallFrom(super);  // don't have to display this one
  477.     DView *esubj= NULL; 
  478.     DView *eccopy= NULL;
  479.  
  480.     (void) new DPrompt(0, super, "Max. documents to send");
  481.     super->NextSubviewToRight();
  482.     fDocs= new DEditText(0,super,"20",6);
  483.     super->NextSubviewBelowLeft();
  484.  
  485.     (void) new DPrompt(0, super, "Max. lines to send");
  486.     super->NextSubviewToRight();
  487.     fLines= new DEditText(0,super,"1000",6);
  488.     super->NextSubviewBelowLeft();
  489.     
  490.     (void) new DPrompt(0, super, "Starting document number");
  491.     super->NextSubviewToRight();
  492.     fStart= new DEditText(0,super,"1",6);
  493.     super->NextSubviewBelowLeft();
  494.     
  495.     fTitles= new DCheckBox(0,super,"Display titles only");
  496.     super->NextSubviewBelowLeft();
  497.  
  498.     (void) new DPrompt(0, super, "Data library");
  499.     super->NextSubviewBelowLeft();
  500.     fLib= new DPopupList( cDataLib, super);
  501.     fLib->AddItem("genbank - latest full GenBank and updates");
  502.     fLib->AddItem("gbupdate - updates to GenBank");
  503.     fLib->AddItem("gbonly - latest full GenBank without updates");
  504.     fLib->AddItem("embl - latest full EMBL");
  505.     fLib->AddItem("emblupdate - updates to EMBL");
  506.     fLib->AddItem("swissprot - latest full Swiss-Prot");
  507.     fLib->AddItem("swissprotupdate - updates to swiss-prot");
  508.     fLib->AddItem("pir - latest full PIR");
  509.     //fLib->AddItem("pdb - from Brookhaven Protein Data Bank");
  510.     fLib->AddItem("vector - vector subset of GenBank");
  511.     fLib->AddItem("vecbase - Vecbase, 1987 version");
  512.     fLib->AddItem("genpept - GenPept, translated from full GenBank");
  513.     fLib->AddItem("gpupdate - updates to GenPept");
  514.     fLib->AddItem("kabatnuc - dna of Kabat's immunological seqs");
  515.     fLib->AddItem("kabatpro - protein of Kabat's immunological seqs");
  516.     fLib->AddItem("epd - eukaroytic promotors");
  517.     fLib->AddItem("tfd - transcription factors database");
  518.     fLib->SetValue(1);
  519.     super->NextSubviewBelowLeft();
  520.  
  521.     super= this;
  522.     super->NextSubviewBelowLeft();
  523.  
  524.     char *shorthelp= 
  525. "Your query can contain several lines with locus names, accession numbers, authors'"LINEEND
  526. "names, and/or text words. The logical operators AND, OR, and NOT are supported.";
  527.  
  528.     SETNOTEFONT();
  529.     (void) new DNotePanel(0,super,shorthelp, 25*Nlm_stdCharWidth,0,gNoteFont);
  530.     super->NextSubviewBelowLeft();
  531.  
  532.     (void) new DPrompt(0, super, "Your query:");
  533.     super->NextSubviewBelowLeft();
  534.     DView *emsg= this->InstallMessage(super);
  535.     
  536.     SetDlogItems( eto, efrom, eccopy, esubj, emsg);
  537.     
  538.     AddOkayCancelButtons(cSEND,"Send");
  539.     this->NextSubviewToRight();
  540.     DButton* hb= new DButton( cHelpButton, this, "Help");
  541.     hb->SetResize( DView::fixed, DView::moveinsuper);
  542.     
  543.     DWindow::Open();
  544. }
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551. // class DEMBLBlitz
  552.  
  553.  
  554. //char* DEMBLBlitz::kAddress = "seqpup@bio.indiana.edu";
  555. char* DEMBLBlitz::kAddress = "BLITZ@EMBL-Heidelberg.DE";
  556. char* DEMBLBlitz::kTitle = "Blitz Search at EMBL";
  557.  
  558. #ifdef OS_DOS
  559. char* DEMBLBlitz::kHelp     = "embl-bli.hel";     
  560. #else
  561. char* DEMBLBlitz::kHelp     = "embl-blitz.help";     
  562. #endif                                                                     
  563.             
  564.                                                                                 
  565. DEMBLBlitz::DEMBLBlitz( long id, DTaskMaster* itsSuperior, DSequence* theSeq) :
  566.     DSendMailDialog(id, itsSuperior,    -5,  -5,  -50,  -20, kTitle)
  567. {
  568.     fSeq= (DSequence*) theSeq->Clone();
  569. }
  570.  
  571. DEMBLBlitz::~DEMBLBlitz()
  572. {
  573.     delete fSeq;
  574. }
  575.  
  576. char* DEMBLBlitz::BuildMessage()
  577. {
  578.     char        buf[512], name[128];
  579.     char        *msg = NULL;
  580.     Boolean isamino= fBaseKind->GetValue() == 2;
  581.     
  582.             // want IOSTREAMS here !!!!!!!!!!!!!!!!!!!! not damn sprintf's
  583.     DTempFile* qfile = new DTempFile();
  584.  
  585.     fTitle->GetTitle(name,128); 
  586.     if (*name) { sprintf( buf, "TITLE %s\n", name); qfile->WriteLine(buf); }
  587.     
  588.     fAlign->GetTitle(name,128); 
  589.     if (*name) { sprintf( buf, "ALIGN %s\n", name);  qfile->WriteLine(buf); }
  590.  
  591.     fScores->GetTitle(name,128); 
  592.     if (*name) { sprintf( buf, "NAME %s\n", name);    qfile->WriteLine(buf); }
  593.  
  594.     fIndel->GetTitle(name,128); 
  595.     if (*name) { sprintf( buf, "INDEL %s\n", name);    qfile->WriteLine(buf); }
  596.  
  597.     if (isamino) {
  598.         fPam->GetTitle(name,128); 
  599.         sprintf( buf, "PAM %s\n", name);    qfile->WriteLine(buf);
  600.         }
  601.         
  602.     sprintf( buf, "SEQ\n", name);    qfile->WriteLine(buf);
  603.     
  604.         //!! must use bases from fMsg text
  605.     msg= fMsg->GetText();
  606.     fSeq->SetBases( msg);
  607.     MemFree(msg);
  608.     DSeqFile::DontSaveMasks();
  609.     fSeq->DoWrite( qfile, DSeqFile::kPlain); 
  610.     DSeqFile::DoSaveMasks();
  611.         
  612.     sprintf( buf, "END\n");    qfile->WriteLine(buf);
  613.     
  614.     ulong msgbytes;
  615.     msg= qfile->ReadIntoMemory( msgbytes);
  616.     delete qfile;
  617.  
  618.     return msg;
  619. }
  620.  
  621.  
  622.  
  623. Boolean DEMBLBlitz::IsMyAction(DTaskMaster* action) 
  624. {    
  625.     switch(action->Id()) {
  626.  
  627.         case cBaseKind:
  628.             if (fBaseKind->GetValue() == 2) {
  629.                 fPam->Enable();
  630.                 }
  631.             else {
  632.                 fPam->Disable();
  633.                 }
  634.             return true;
  635.             
  636.         case cHelpButton:
  637.             gApplication->OpenHelp(kHelp);
  638.             return true;            
  639.          
  640.         default:
  641.             return DSendMailDialog::IsMyAction(action);    
  642.         }
  643. }
  644.  
  645.  
  646.  
  647. void DEMBLBlitz::Open()
  648. {
  649.     DView* super = this;
  650.  
  651.     char *shorthelp1= 
  652. "MPsrch allows you to perform sensitive and fast comparisons of your protein sequences against"LINEEND
  653. "the Swiss-Prot database using the Smith and Waterman best local similarity algorithm.";
  654.     SETNOTEFONT();
  655.     (void) new DNotePanel(0,super,shorthelp1, 25*Nlm_stdCharWidth,0,gNoteFont);
  656.     super->NextSubviewBelowLeft();
  657.  
  658.     DView *eto  = this->InstallTo(super, kAddress);
  659.     DView *efrom= this->InstallFrom(super);  // don't have to display this one
  660.     DView *esubj= NULL; 
  661.     DView *eccopy= NULL;
  662.  
  663.     fBaseKind= new DCluster(cBaseKind,super,0,0,false,"Bases are");
  664.     super= fBaseKind;
  665.     (void) new DRadioButton(0,super,"Nucleic");
  666.     super->NextSubviewToRight();
  667.     (void) new DRadioButton(0,super,"Amino");
  668.     if (fSeq->IsAmino()) fBaseKind->SetValue(2); else fBaseKind->SetValue(1);
  669.     
  670.     super= this;
  671.     super->NextSubviewBelowLeft();
  672.  
  673.     (void) new DPrompt(0, super, "Max. scores to report");
  674.     super->NextSubviewToRight();
  675.     fScores= new DEditText(0,super,"50",6);
  676.     super->NextSubviewBelowLeft();
  677.  
  678.     (void) new DPrompt(0, super, "Max. best alignments to report");
  679.     super->NextSubviewToRight();
  680.     fAlign= new DEditText(0,super,"50",6);
  681.     super->NextSubviewBelowLeft();
  682.  
  683.     (void) new DPrompt(0, super, "Indel penalty (option)");
  684.     super->NextSubviewToRight();
  685.     fIndel= new DEditText(0,super,NULL,6);
  686.     super->NextSubviewBelowLeft();
  687.  
  688.     (void) new DPrompt(0, super, "PAM value from 1..500 (protein option)");
  689.     super->NextSubviewToRight();
  690.     fPam= new DEditText(0,super,NULL,6);
  691.     if (!fSeq->IsAmino()) fPam->Disable();
  692.     super->NextSubviewBelowLeft();
  693.  
  694.     (void) new DPrompt(0, super, "Title of this search");
  695.     super->NextSubviewBelowLeft();
  696.     char  title[80];
  697.     StrCpy(title, "Blitz of ");
  698.     StrNCat(title, fSeq->Name(), 30);
  699.     fTitle= new DEditText(0,super,title,30);
  700.     super->NextSubviewBelowLeft();
  701.  
  702.     (void) new DPrompt(0, super, "Your query sequence:");
  703.     super->NextSubviewBelowLeft();
  704.     DView *emsg= this->InstallMessage(super, fSeq->Bases());
  705.     
  706.     SetDlogItems( eto, efrom, eccopy, esubj, emsg);
  707.     
  708.     AddOkayCancelButtons(cSEND,"Send");
  709.     this->NextSubviewToRight();
  710.     DButton* hb= new DButton( cHelpButton, this, "Help");
  711.     hb->SetResize( DView::fixed, DView::moveinsuper);
  712.     
  713.     DWindow::Open();
  714. }
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722. // class DEMBLFasta
  723.  
  724.  
  725. char* DEMBLFasta::kAddress = "FASTA@EMBL-Heidelberg.DE";
  726. char* DEMBLFasta::kTitle = "FastA Search at EMBL";
  727. #ifdef OS_DOS
  728. char* DEMBLFasta::kHelp     = "embl-fas.hel";     
  729. #else
  730. char* DEMBLFasta::kHelp     = "embl-fasta.help";     
  731. #endif                                                                     
  732.             
  733.                                                                                 
  734. DEMBLFasta::DEMBLFasta( long id, DTaskMaster* itsSuperior, DSequence* theSeq) :
  735.     DSendMailDialog(id, itsSuperior,    -5,  -5,  -50,  -20, kTitle)
  736. {
  737.     fSeq= (DSequence*) theSeq->Clone();
  738. }
  739.  
  740. DEMBLFasta::~DEMBLFasta()
  741. {
  742.     delete fSeq;
  743. }
  744.  
  745. char* DEMBLFasta::BuildMessage()
  746. {
  747.     char        buf[512], name[128], *cp;
  748.     short         item;
  749.     char        *msg = NULL;
  750.     Boolean isamino= fBaseKind->GetValue() == 2;
  751.     
  752.             // want IOSTREAMS here !!!!!!!!!!!!!!!!!!!! not damn sprintf's
  753.     DTempFile* qfile = new DTempFile();
  754.  
  755.     fTitle->GetTitle(name,128); 
  756.     if (*name) { sprintf( buf, "TITLE %s\n", name); qfile->WriteLine(buf); }
  757.     
  758.     fScores->GetTitle(name,128); 
  759.     if (*name) { sprintf( buf, "LIST %s\n", name);    qfile->WriteLine(buf); }
  760.  
  761.     fAlign->GetTitle(name,128); 
  762.     if (*name) { sprintf( buf, "ALIGN %s\n", name);  qfile->WriteLine(buf); }
  763.  
  764.     fWord->GetTitle(name,128); 
  765.     if (*name) { sprintf( buf, "WORD %s\n", name);    qfile->WriteLine(buf); }
  766.  
  767.     fLib->GetSelectedItem(item,name,128);
  768.     cp= StrChr( name, ' '); if (cp) *cp= 0;
  769.     if (*name) { sprintf( buf, "LIB %s\n", name);    qfile->WriteLine(buf); }
  770.      
  771.     if (!fBothStrands->GetStatus()) { 
  772.         sprintf( buf, "ONE\n");    qfile->WriteLine(buf); 
  773.         }
  774.     
  775.     if (isamino && fSeq->LengthF()<50) {
  776.         sprintf( buf, "PROT\n");    qfile->WriteLine(buf);
  777.         }
  778.         
  779.     sprintf( buf, "SEQ %s\n", name);    qfile->WriteLine(buf);
  780.     
  781.         //!! must use bases from fMsg text
  782.     msg= fMsg->GetText();
  783.     fSeq->SetBases( msg);
  784.     MemFree(msg);
  785.     DSeqFile::DontSaveMasks();
  786.     fSeq->DoWrite( qfile, DSeqFile::kPlain); 
  787.     DSeqFile::DoSaveMasks();
  788.         
  789.     sprintf( buf, "END\n");    qfile->WriteLine(buf);
  790.     
  791.     ulong msgbytes;
  792.     msg= qfile->ReadIntoMemory( msgbytes);
  793.     delete qfile;
  794.  
  795.     return msg;
  796. }
  797.  
  798.  
  799.  
  800. Boolean DEMBLFasta::IsMyAction(DTaskMaster* action) 
  801. {    
  802.     switch(action->Id()) {
  803.  
  804.         case cBaseKind:
  805.             if (fBaseKind->GetValue() == 2) {
  806.                 //fPam->Enable();
  807.                 }
  808.             else {
  809.                 //fPam->Disable();
  810.                 }
  811.             return true;
  812.             
  813.         case cHelpButton:
  814.             gApplication->OpenHelp(kHelp);
  815.             return true;            
  816.          
  817.         default:
  818.             return DSendMailDialog::IsMyAction(action);    
  819.         }
  820. }
  821.  
  822.  
  823.  
  824. void DEMBLFasta::Open()
  825. {
  826.     DView* super = this;
  827.  
  828.     char *shorthelp1= 
  829. "This is based on the FASTA program developed by Pearson and Lipman.  It allows you to perform"LINEEND
  830. "fast and sensitive comparisons of your nucleic acid or protein sequences against various databases.";
  831.     SETNOTEFONT();
  832.     (void) new DNotePanel(0,super,shorthelp1, 25*Nlm_stdCharWidth,0,gNoteFont);
  833.     super->NextSubviewBelowLeft();
  834.  
  835.     DView *eto  = this->InstallTo(super, kAddress);
  836.     DView *efrom= this->InstallFrom(super);  // don't have to display this one
  837.     DView *esubj= NULL; 
  838.     DView *eccopy= NULL;
  839.  
  840.  
  841.     (void) new DPrompt(0, super, "Data library:");
  842.     super->NextSubviewBelowLeft();
  843.     fLib= new DPopupList( cDataLib, super);
  844.     fLib->AddItem("EMALL - latest full EMBL & updates");
  845.     fLib->AddItem("EMNEW - updates to EMBL");
  846.     fLib->AddItem(" --- ");
  847.     fLib->AddItem("EFUN - EMBL fungi division only");
  848.     fLib->AddItem("EINV - EMBL invertebrates division only");
  849.     fLib->AddItem("EMAM - EMBL mammals division only");
  850.     fLib->AddItem("EORG - EMBL organelles division only");
  851.     fLib->AddItem("EPHG - EMBL phages division only");
  852.     fLib->AddItem("EPLN - EMBL plants division only");
  853.     fLib->AddItem("EPRI - EMBL primates division only");
  854.     fLib->AddItem("EPRO - EMBL prokaryotes division only");
  855.     fLib->AddItem("EROD - EMBL rodents division only");
  856.     fLib->AddItem("ESYN - EMBL synthetic division only");
  857.     fLib->AddItem("EUNA - EMBL unannotated division only");
  858.     fLib->AddItem("EVRL - EMBL viruses division only");
  859.     fLib->AddItem("EVRT - EMBL vertebrates division only");
  860.     fLib->AddItem(" --- ");
  861.     fLib->AddItem("GBALL - latest full GenBank & updates");
  862.     fLib->AddItem("GBNEW - updates to GenBank");
  863.     fLib->AddItem("GBONLY - latest full GenBank");
  864.     fLib->AddItem("GENEMBL - latest full Genbank & EMBL");
  865.     fLib->AddItem("GENEW - updates to GenBank & EMBL");
  866.     fLib->AddItem(" --- ");
  867.     fLib->AddItem("SWALL - latest full swiss-prot & updates");
  868.     fLib->AddItem("SWNEW - updates to swiss-prot");
  869.     fLib->AddItem("SW - latest full swiss-prot");
  870.     fLib->AddItem("NBRF - latest full NBRF|PIR");
  871.     fLib->AddItem("PIRONLY - entries in PIR, but not swiss-prot");
  872.     fLib->AddItem("SWISSPIRALL - latest full swiss-prot & PIR");
  873.     fLib->AddItem("BROOKHAVEN - from Brookhaven protein data bank");
  874.     fLib->AddItem("NRL - from Brookhaven PDB, NBRF version");
  875.     fLib->SetValue(1);
  876.     super->NextSubviewBelowLeft();
  877.  
  878.  
  879.     (void) new DPrompt(0, super, "Max. scores to report");
  880.     super->NextSubviewToRight();
  881.     fScores= new DEditText(0,super,"50",6);
  882.     super->NextSubviewBelowLeft();
  883.  
  884.     (void) new DPrompt(0, super, "Max. best alignments to report");
  885.     super->NextSubviewToRight();
  886.     fAlign= new DEditText(0,super,"10",6);
  887.     super->NextSubviewBelowLeft();
  888.  
  889.     (void) new DPrompt(0, super, "Word size (optional)");
  890.     super->NextSubviewToRight();
  891.     fWord= new DEditText(0,super,NULL,6);
  892.     super->NextSubviewBelowLeft();
  893.  
  894.     fBaseKind= new DCluster(cBaseKind,super,0,0,false,"Bases are");
  895.     super= fBaseKind;
  896.     (void) new DRadioButton(0,super,"Nucleic");
  897.     super->NextSubviewToRight();
  898.     (void) new DRadioButton(0,super,"Amino");
  899.     if (fSeq->IsAmino()) fBaseKind->SetValue(2); else fBaseKind->SetValue(1);
  900.     
  901.     super= this;
  902.     super->NextSubviewToRight();
  903.     fBothStrands= new DCheckBox(0,super,"Search both strands");
  904.     fBothStrands->SetStatus(true);
  905.     super->NextSubviewBelowLeft();
  906.  
  907.     (void) new DPrompt(0, super, "Title of this search");
  908.     super->NextSubviewBelowLeft();
  909.     char  title[80];
  910.     StrCpy(title, "FastA of ");
  911.     StrNCat(title, fSeq->Name(), 30);
  912.     fTitle= new DEditText(0,super,title,30);
  913.     super->NextSubviewBelowLeft();
  914.  
  915.     (void) new DPrompt(0, super, "Your query sequence:");
  916.     super->NextSubviewBelowLeft();
  917.     DView *emsg= this->InstallMessage(super, fSeq->Bases());
  918.     
  919.     SetDlogItems( eto, efrom, eccopy, esubj, emsg);
  920.     
  921.     AddOkayCancelButtons(cSEND,"Send");
  922.     this->NextSubviewToRight();
  923.     DButton* hb= new DButton( cHelpButton, this, "Help");
  924.     hb->SetResize( DView::fixed, DView::moveinsuper);
  925.     
  926.     DWindow::Open();
  927. }
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937. // class DEMBLQuicks
  938.  
  939.  
  940. char* DEMBLQuicks::kAddress = "QUICK@EMBL-Heidelberg.DE";
  941. char* DEMBLQuicks::kTitle = "QuickSearch at EMBL";
  942. #ifdef OS_DOS
  943. char* DEMBLQuicks::kHelp     = "emblquic.hel";     
  944. #else
  945. char* DEMBLQuicks::kHelp     = "embl-quicksearch.help";     
  946. #endif                                                                     
  947.             
  948.                                                                                 
  949. DEMBLQuicks::DEMBLQuicks( long id, DTaskMaster* itsSuperior, DSequence* theSeq) :
  950.     DSendMailDialog(id, itsSuperior,    -5,  -5,  -50,  -20, kTitle),
  951.     fSeq(NULL)
  952. {
  953.     if (theSeq->IsAmino()) {
  954.             Message(MSG_OK,"This method not available for Amino sequences.");
  955.             delete this;
  956.             return;
  957.             }
  958.     fSeq= (DSequence*) theSeq->Clone();
  959. }
  960.  
  961. DEMBLQuicks::~DEMBLQuicks()
  962. {
  963.     if (fSeq) delete fSeq;
  964. }
  965.  
  966. char* DEMBLQuicks::BuildMessage()
  967. {
  968.     char        buf[512], name[128], *cp;
  969.     short         item;
  970.     char        *msg = NULL;
  971.     
  972.             // want IOSTREAMS here !!!!!!!!!!!!!!!!!!!! not damn sprintf's
  973.     DTempFile* qfile = new DTempFile();
  974.  
  975.     fTitle->GetTitle(name,128); 
  976.     if (*name) { sprintf( buf, "TITLE %s\n", name); qfile->WriteLine(buf); }
  977.     
  978.     fLib->GetSelectedItem(item,name,128);
  979.     cp= StrChr( name, ' '); if (cp) *cp= 0;
  980.     if (*name) { sprintf( buf, "LIB %s\n", name);    qfile->WriteLine(buf); }
  981.      
  982.     fStringency->GetTitle(name,128); 
  983.     if (*name) { sprintf( buf, "STRINGENCY %s\n", name);  qfile->WriteLine(buf); }
  984.  
  985.     fWindow->GetTitle(name,128); 
  986.     if (*name) { sprintf( buf, "WINDOW %s\n", name);    qfile->WriteLine(buf); }
  987.  
  988.     if (fPerfect->GetStatus()) { 
  989.         sprintf( buf, "PERFECT\n");    qfile->WriteLine(buf); 
  990.         }
  991.     else {
  992.         fMatch->GetTitle(name,128); 
  993.         if (*name) { sprintf( buf, "MATCH %s\n", name);    qfile->WriteLine(buf); }
  994.         }
  995.  
  996.     fBest->GetSelectedItem(item,name,128);
  997.     if (item == 2) { sprintf( buf, "BEST\n");    qfile->WriteLine(buf); }
  998.  
  999.     if (!fBothStrands->GetStatus()) { 
  1000.         sprintf( buf, "ONE\n");    qfile->WriteLine(buf); 
  1001.         }
  1002.         
  1003.     sprintf( buf, "SEQ\n", name);    qfile->WriteLine(buf);
  1004.     
  1005.         //!! must use bases from fMsg text
  1006.     msg= fMsg->GetText();
  1007.     fSeq->SetBases( msg);
  1008.     MemFree(msg);
  1009.     DSeqFile::DontSaveMasks();
  1010.     fSeq->DoWrite( qfile, DSeqFile::kPlain); 
  1011.     DSeqFile::DoSaveMasks();
  1012.         
  1013.     sprintf( buf, "END\n");    qfile->WriteLine(buf);
  1014.     
  1015.     ulong msgbytes;
  1016.     msg= qfile->ReadIntoMemory( msgbytes);
  1017.     delete qfile;
  1018.  
  1019.     return msg;
  1020. }
  1021.  
  1022.  
  1023.  
  1024. Boolean DEMBLQuicks::IsMyAction(DTaskMaster* action) 
  1025. {    
  1026.     switch(action->Id()) {
  1027.  
  1028.         case cHelpButton:
  1029.             gApplication->OpenHelp(kHelp);
  1030.             return true;            
  1031.          
  1032.         default:
  1033.             return DSendMailDialog::IsMyAction(action);    
  1034.         }
  1035. }
  1036.  
  1037.  
  1038.  
  1039. void DEMBLQuicks::Open()
  1040. {
  1041.     DView* super = this;
  1042.  
  1043.     char *shorthelp1= 
  1044. "This is based on the QUICKSEARCH and QUICKSHOW programs developed by John Devereux"LINEEND
  1045. "as implemented in the GCG package.  It allows you to perform very rapid comparisons"LINEEND
  1046. "of your nucleic acid sequences against the EMBL and GenBank databases including the"LINEEND
  1047. "most recent entries.";
  1048.     SETNOTEFONT();
  1049.     (void) new DNotePanel(0,super,shorthelp1, 25*Nlm_stdCharWidth,0,gNoteFont);
  1050.     super->NextSubviewBelowLeft();
  1051.  
  1052.     DView *eto  = this->InstallTo(super, kAddress);
  1053.     DView *efrom= this->InstallFrom(super);  // don't have to display this one
  1054.     DView *esubj= NULL; 
  1055.     DView *eccopy= NULL;
  1056.  
  1057.     (void) new DPrompt(0, super, "Data library:");
  1058.     super->NextSubviewBelowLeft();
  1059.     fLib= new DPopupList( 0, super);
  1060.     fLib->AddItem("ALL - all EMBL and GenBank entries");
  1061.     fLib->AddItem("GENEW - updates to GenBank & EMBL");
  1062.     fLib->SetValue(1);
  1063.     super->NextSubviewBelowLeft();
  1064.  
  1065.     (void) new DPrompt(0, super, "Percent identity for match");
  1066.     super->NextSubviewToRight();
  1067.     fMatch= new DEditText(0,super,"90",6);
  1068.     super->NextSubviewBelowLeft();
  1069.  
  1070.     fPerfect= new DCheckBox(0,super,"Perfect matches only");
  1071.     super->NextSubviewToRight();
  1072.     fBothStrands= new DCheckBox(0,super,"Search both strands");
  1073.     fBothStrands->SetStatus(true);
  1074.     super->NextSubviewBelowLeft();
  1075.  
  1076.     (void) new DPrompt(0, super, "Window (option)");
  1077.     super->NextSubviewToRight();
  1078.     fWindow= new DEditText(0,super,NULL,6);
  1079.     super->NextSubviewBelowLeft();
  1080.  
  1081.     (void) new DPrompt(0, super, "Stringency (option)");
  1082.     super->NextSubviewToRight();
  1083.     fStringency= new DEditText(0,super,NULL,6);
  1084.     super->NextSubviewBelowLeft();
  1085.  
  1086.     (void) new DPrompt(0, super, "Aligment method");
  1087.     super->NextSubviewToRight();
  1088.     fBest= new DPopupList( 0, super);
  1089.     fBest->AddItem("Needleman-Wunsch");
  1090.     fBest->AddItem("Local-homology");
  1091.     fBest->SetValue(1);
  1092.     super->NextSubviewBelowLeft();
  1093.  
  1094.     (void) new DPrompt(0, super, "Title of this search");
  1095.     super->NextSubviewBelowLeft();
  1096.     char  title[80];
  1097.     StrCpy(title, "Quicksearch of ");
  1098.     StrNCat(title, fSeq->Name(), 30);
  1099.     fTitle= new DEditText(0,super,title,30);
  1100.     super->NextSubviewBelowLeft();
  1101.  
  1102.     (void) new DPrompt(0, super, "Your query sequence:");
  1103.     super->NextSubviewBelowLeft();
  1104.     DView *emsg= this->InstallMessage(super, fSeq->Bases());
  1105.     
  1106.     SetDlogItems( eto, efrom, eccopy, esubj, emsg);
  1107.     
  1108.     AddOkayCancelButtons(cSEND,"Send");
  1109.     this->NextSubviewToRight();
  1110.     DButton* hb= new DButton( cHelpButton, this, "Help");
  1111.     hb->SetResize( DView::fixed, DView::moveinsuper);
  1112.     
  1113.     DWindow::Open();
  1114. }
  1115.  
  1116.  
  1117.  
  1118.  
  1119. // class DEMBLFetch
  1120.  
  1121. char* DEMBLFetch::kAddress = "NETSERV@EMBL-Heidelberg.DE";
  1122. char* DEMBLFetch::kTitle = "Fetch from EMBL";
  1123. #ifdef OS_DOS
  1124. char* DEMBLFetch::kHelp     = "embl-fet.hel";     
  1125. #else
  1126. char* DEMBLFetch::kHelp     = "embl-fetch.help";     
  1127. #endif                                            
  1128.                          
  1129.                                                                                 
  1130. DEMBLFetch::DEMBLFetch( long id, DTaskMaster* itsSuperior) :
  1131.     DSendMailDialog(id, itsSuperior,    -5,  -5,  -50,  -20, kTitle)
  1132. {
  1133. }
  1134.  
  1135. char* DEMBLFetch::BuildMessage()
  1136. {
  1137.     return fMsg->GetText();
  1138. }
  1139.  
  1140. Boolean DEMBLFetch::IsMyAction(DTaskMaster* action) 
  1141. {    
  1142.     switch(action->Id()) {
  1143.             
  1144.         case cHelpButton:
  1145.             gApplication->OpenHelp(kHelp);
  1146.             return true;            
  1147.          
  1148.         default:
  1149.             return DSendMailDialog::IsMyAction(action);    
  1150.         }
  1151. }
  1152.  
  1153.  
  1154. void DEMBLFetch::Open()
  1155. {
  1156.     DView* super = this;
  1157.  
  1158.     DView *eto  = this->InstallTo(super, kAddress);
  1159.     DView *efrom= this->InstallFrom(super);  // don't have to display this one
  1160.     DView *esubj= NULL; 
  1161.     DView *eccopy= NULL;
  1162.  
  1163.     char *shorthelp1= 
  1164. "Send one command per line. The general syntax is 'GET database:accnumber' where database is"LINEEND
  1165. "either NUC (EMBL or GenBank) or PROT (Swiss-Prot), eg. 'GET NUC:J00179'"LINEEND
  1166. "Include the command HELP to get introductory information.";
  1167.  
  1168.     SETNOTEFONT();
  1169.     (void) new DNotePanel(0,super,shorthelp1, 25*Nlm_stdCharWidth,0,gNoteFont);
  1170.     super->NextSubviewBelowLeft();
  1171.  
  1172.     (void) new DPrompt(0, super, "Your query:");
  1173.     super->NextSubviewBelowLeft();
  1174.     DView *emsg= this->InstallMessage(super);
  1175.     
  1176.     SetDlogItems( eto, efrom, eccopy, esubj, emsg);
  1177.     
  1178.     AddOkayCancelButtons(cSEND,"Send");
  1179.     this->NextSubviewToRight();
  1180.     DButton* hb= new DButton( cHelpButton, this, "Help");
  1181.     hb->SetResize( DView::fixed, DView::moveinsuper);
  1182.     
  1183.     DWindow::Open();
  1184. }
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191. // class DFHCRCfetch
  1192.  
  1193. char* DFHCRCfetch::kAddress = "blocks@howard.fhcrc.org";
  1194. char* DFHCRCfetch::kTitle = "Fetch from FHCRC BLOCKS";
  1195. #ifdef OS_DOS
  1196. char* DFHCRCfetch::kHelp     = "fhcrc-bl.hel";     
  1197. #else
  1198. char* DFHCRCfetch::kHelp     = "fhcrc-blocks.help";     
  1199. #endif                                            
  1200.      
  1201.                                                                                 
  1202. DFHCRCfetch::DFHCRCfetch( long id, DTaskMaster* itsSuperior) :
  1203.     DSendMailDialog(id, itsSuperior,    -5,  -5,  -50,  -20, kTitle)
  1204. {
  1205. }
  1206.  
  1207. char* DFHCRCfetch::BuildMessage()
  1208. {
  1209.     return "";  // sendmail requires nonNULL msg string
  1210. }
  1211.  
  1212. Boolean DFHCRCfetch::IsMyAction(DTaskMaster* action) 
  1213. {    
  1214.     switch(action->Id()) {
  1215.             
  1216.         case cHelpButton:
  1217.             gApplication->OpenHelp(kHelp);
  1218.             return true;            
  1219.          
  1220.         default:
  1221.             {
  1222.             char sub[128];
  1223.             fSubj->GetTitle(sub, 80);
  1224.             if (StrNICmp(sub,"GET ",4) != 0) {
  1225.                 char newsub[128];
  1226.                 StrCpy(newsub, "GET ");
  1227.                 StrCat(newsub, sub);
  1228.                 fSubj->SetTitle(newsub);
  1229.                 }
  1230.             return DSendMailDialog::IsMyAction(action);    
  1231.             }
  1232.         }
  1233. }
  1234.  
  1235. DView* DFHCRCfetch::InstallSubject(DView* super, char* subjStr)
  1236. {
  1237.     DPrompt* pr= new DPrompt(0, super, "Blocks to get:", 0, 0, Nlm_programFont);
  1238.     super->NextSubviewToRight();
  1239.  
  1240.     DDialogText* esubj= new DEditText(cSubj, super, subjStr, 20);
  1241.     this->SetEditText(esubj);
  1242.     super->NextSubviewBelowLeft();
  1243.     return esubj;
  1244. }
  1245.  
  1246.  
  1247. void DFHCRCfetch::Open()
  1248. {
  1249.     DView* super = this;
  1250.  
  1251.     DView *eto  = this->InstallTo(super, kAddress);
  1252.     DView *efrom= this->InstallFrom(super);  // don't have to display this one
  1253.  
  1254.     char *shorthelp1=
  1255. "Specify one BLOCKS number to get per message, eg. 'GET BL00044'";
  1256.     SETNOTEFONT();
  1257.     (void) new DNotePanel(0,super,shorthelp1, 20*Nlm_stdCharWidth,0,gNoteFont);
  1258.     super->NextSubviewBelowLeft();
  1259.  
  1260.     DView *esubj= this->InstallSubject(super, "GET "); 
  1261.     DView *eccopy= NULL;
  1262.  
  1263.     //(void) new DPrompt(0, super, "Your query:");
  1264.     //super->NextSubviewBelowLeft();
  1265.     DView *emsg= NULL; //= this->InstallMessage(super);
  1266.     
  1267.     SetDlogItems( eto, efrom, eccopy, esubj, emsg);
  1268.     
  1269.     AddOkayCancelButtons(cSEND,"Send");
  1270.     this->NextSubviewToRight();
  1271.     DButton* hb= new DButton( cHelpButton, this, "Help");
  1272.     hb->SetResize( DView::fixed, DView::moveinsuper);
  1273.     
  1274.     DWindow::Open();
  1275. }
  1276.  
  1277.  
  1278.  
  1279. // class DFHCRCblocks
  1280.  
  1281.  
  1282. char* DFHCRCblocks::kAddress = "blocks@howard.fhcrc.org";
  1283. char* DFHCRCblocks::kTitle = "BLOCKS Search at FHCRC";
  1284. #ifdef OS_DOS
  1285. char* DFHCRCblocks::kHelp     = "fhcrc-bl.hel";     
  1286. #else
  1287. char* DFHCRCblocks::kHelp     = "fhcrc-blocks.help";     
  1288. #endif                                                                     
  1289.             
  1290.                                                                                 
  1291. DFHCRCblocks::DFHCRCblocks( long id, DTaskMaster* itsSuperior, DSequence* theSeq) :
  1292.     DSendMailDialog(id, itsSuperior,    -5,  -5,  -50,  -20, kTitle)
  1293. {
  1294.     fSeq= (DSequence*) theSeq->Clone();
  1295. }
  1296.  
  1297. DFHCRCblocks::~DFHCRCblocks()
  1298. {
  1299.     delete fSeq;
  1300. }
  1301.  
  1302. char* DFHCRCblocks::BuildMessage()
  1303. {
  1304.     char        *msg = NULL;
  1305.     
  1306.             // want IOSTREAMS here !!!!!!!!!!!!!!!!!!!! not damn sprintf's
  1307.     DTempFile* qfile = new DTempFile();
  1308.  
  1309.     msg= fMsg->GetText();
  1310.     fSeq->SetBases( msg);
  1311.     MemFree(msg);
  1312.     DSeqFile::DontSaveMasks();
  1313.     fSeq->DoWrite( qfile, DSeqFile::kPearson); 
  1314.     DSeqFile::DoSaveMasks();
  1315.             
  1316.     ulong msgbytes;
  1317.     msg= qfile->ReadIntoMemory( msgbytes);
  1318.     delete qfile;
  1319.  
  1320.     return msg;
  1321. }
  1322.  
  1323.  
  1324. Boolean DFHCRCblocks::IsMyAction(DTaskMaster* action) 
  1325. {    
  1326.     switch(action->Id()) {
  1327.  
  1328.         case cHelpButton:
  1329.             gApplication->OpenHelp(kHelp);
  1330.             return true;            
  1331.          
  1332.         default:
  1333.             return DSendMailDialog::IsMyAction(action);    
  1334.         }
  1335. }
  1336.  
  1337.  
  1338.  
  1339. void DFHCRCblocks::Open()
  1340. {
  1341.     DView* super = this;
  1342.  
  1343.     char* shorthelp1 =
  1344. "As an aid to detection and verification of protein sequence homology, the BLOCKS e-mail"LINEEND
  1345. "searcher compares a protein or DNA sequence to the current database of protein blocks."LINEEND
  1346. "Blocks are short multiply aligned ungapped segments corresponding to the most highly"LINEEND
  1347. "conserved regions of proteins.";
  1348.     SETNOTEFONT();
  1349.     (void) new DNotePanel(0,super,shorthelp1, 25*Nlm_stdCharWidth,0,gNoteFont);
  1350.     super->NextSubviewBelowLeft();
  1351.  
  1352.     DView *eto  = this->InstallTo(super, kAddress);
  1353.     DView *efrom= this->InstallFrom(super);  // don't have to display this one
  1354.     DView *esubj= NULL; 
  1355.     DView *eccopy= NULL;
  1356.  
  1357.     (void) new DPrompt(0, super, "Your query sequence:");
  1358.     super->NextSubviewBelowLeft();
  1359.     DView *emsg= this->InstallMessage(super, fSeq->Bases());
  1360.     
  1361.     SetDlogItems( eto, efrom, eccopy, esubj, emsg);
  1362.     
  1363.     AddOkayCancelButtons(cSEND,"Send");
  1364.     this->NextSubviewToRight();
  1365.     DButton* hb= new DButton( cHelpButton, this, "Help");
  1366.     hb->SetResize( DView::fixed, DView::moveinsuper);
  1367.     
  1368.     DWindow::Open();
  1369. }
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379. // class DUWFGeneID
  1380.  
  1381.  
  1382. char* DUWFGeneID::kAddress = "geneid@bir.cedb.uwf.edu";
  1383. char* DUWFGeneID::kTitle = "GeneID at U.W.Florida";
  1384. #ifdef OS_DOS
  1385. char* DUWFGeneID::kHelp     = "geneid.hel";     
  1386. #else
  1387. char* DUWFGeneID::kHelp     = "geneid.help";     
  1388. #endif                                                                     
  1389.             
  1390.                                                                                 
  1391. DUWFGeneID::DUWFGeneID( long id, DTaskMaster* itsSuperior, DSequence* theSeq) :
  1392.     DSendMailDialog(id, itsSuperior,    -5,  -5,  -50,  -20, kTitle),
  1393.     fSeq(NULL)
  1394. {
  1395.     fSeq= (DSequence*) theSeq->Clone();
  1396. }
  1397.  
  1398. DUWFGeneID::~DUWFGeneID()
  1399. {
  1400.     if (fSeq) delete fSeq;
  1401. }
  1402.  
  1403. char* DUWFGeneID::BuildMessage()
  1404. {
  1405.     char        buf[512], name[128], name2[128];
  1406.     char        *msg = NULL;
  1407.     
  1408.             // want IOSTREAMS here !!!!!!!!!!!!!!!!!!!! not damn sprintf's
  1409.     DTempFile* qfile = new DTempFile();
  1410.  
  1411.      sprintf( buf, "Genomic Sequence");    qfile->WriteLine(buf);
  1412.  
  1413.     if (fSmall->GetStatus()) { 
  1414.         sprintf( buf, " -small_output");    qfile->WriteLine(buf); 
  1415.         }
  1416.     if (!fExonBlast->GetStatus()) { 
  1417.         sprintf( buf, " -noexonblast");    qfile->WriteLine(buf); 
  1418.         }
  1419.     if (fGeneBlast->GetStatus()) { 
  1420.         sprintf( buf, " -geneblast");    qfile->WriteLine(buf); 
  1421.         }
  1422.     if (fNetGene->GetStatus()) { 
  1423.         sprintf( buf, " -netgene");    qfile->WriteLine(buf); 
  1424.         }
  1425.      
  1426.     fCodeX->GetTitle(name,128); 
  1427.     fCodeY->GetTitle(name2,128); 
  1428.     if (*name && *name2) {    
  1429.         sprintf( buf, " -known_coding %s %s",name,name2);    
  1430.         qfile->WriteLine(buf); 
  1431.         }
  1432.  
  1433.     fFirstX->GetTitle(name,128); 
  1434.     fFirstY->GetTitle(name2,128); 
  1435.     if (*name && *name2) {    
  1436.         sprintf( buf, " -first_exon %s %s",name,name2);    
  1437.         qfile->WriteLine(buf); 
  1438.         }
  1439.  
  1440.     fLastX->GetTitle(name,128); 
  1441.     fLastY->GetTitle(name2,128); 
  1442.     if (*name && *name2) {    
  1443.         sprintf( buf, " -last_exon %s %s",name,name2);    
  1444.         qfile->WriteLine(buf); 
  1445.         }
  1446.         
  1447.     fAltX->GetTitle(name,128); 
  1448.     fAltY->GetTitle(name2,128); 
  1449.     if (*name && *name2) {    
  1450.         sprintf( buf, " -alt_splicing %s %s",name,name2);    
  1451.         qfile->WriteLine(buf); 
  1452.         }
  1453.  
  1454.      sprintf( buf, "\n\n");    qfile->WriteLine(buf);
  1455.  
  1456.     msg= fMsg->GetText();
  1457.     fSeq->SetBases( msg);
  1458.     MemFree(msg);
  1459.     DSeqFile::DontSaveMasks();
  1460.     fSeq->DoWrite( qfile, DSeqFile::kPearson); 
  1461.     DSeqFile::DoSaveMasks();
  1462.             
  1463.     ulong msgbytes;
  1464.     msg= qfile->ReadIntoMemory( msgbytes);
  1465.     delete qfile;
  1466.  
  1467.     return msg;
  1468. }
  1469.  
  1470.  
  1471.  
  1472. Boolean DUWFGeneID::IsMyAction(DTaskMaster* action) 
  1473. {    
  1474.     switch(action->Id()) {
  1475.  
  1476.         case cHelpButton:
  1477.             gApplication->OpenHelp(kHelp);
  1478.             return true;            
  1479.          
  1480.         default:
  1481.             return DSendMailDialog::IsMyAction(action);    
  1482.         }
  1483. }
  1484.  
  1485.  
  1486.  
  1487. void DUWFGeneID::Open()
  1488. {
  1489.     DView* super = this;
  1490.     DCluster* clu;
  1491.  
  1492.     char *shorthelp1= 
  1493. "GeneID is an Artificial Intelligence system for analyzing vertebrate genomic DNA and"LINEEND
  1494. "prediction of exons and gene structure. You have the option of having NetGene splice"LINEEND
  1495. "site analysis also.  GeneID currently offers no analysis of cDNA or protein sequences.";
  1496.      
  1497.     SETNOTEFONT();
  1498.     (void) new DNotePanel(0,super,shorthelp1, 25*Nlm_stdCharWidth,0,gNoteFont);
  1499.     super->NextSubviewBelowLeft();
  1500.  
  1501.     DView *eto  = this->InstallTo(super, kAddress);
  1502.     DView *efrom= this->InstallFrom(super);  // don't have to display this one
  1503.     DView *esubj= NULL; 
  1504.     DView *eccopy= NULL;
  1505.  
  1506.     clu= new DCluster(0,super,0,0,false,"Options");
  1507.     super= clu;
  1508.  
  1509.     (void) new DPrompt(0, super, "NetGene analysis also");
  1510.     super->NextSubviewToRight();
  1511.     fNetGene= new DCheckBox(0,super,"");
  1512.     super->NextSubviewToRight();
  1513.     
  1514.     (void) new DPrompt(0, super, "Brief output");
  1515.     super->NextSubviewToRight();
  1516.     fSmall= new DCheckBox(0,super,"");
  1517.     super->NextSubviewBelowLeft();
  1518.  
  1519.     (void) new DPrompt(0, super, "Compare predicted gene model to aa databases w/ blast");
  1520.     super->NextSubviewToRight();
  1521.     fGeneBlast= new DCheckBox(0,super, "");
  1522.     super->NextSubviewBelowLeft();
  1523.  
  1524.     (void) new DPrompt(0, super, "Use exon blast (protein database search)");
  1525.     super->NextSubviewToRight();
  1526.     fExonBlast= new DCheckBox(0,super,"");
  1527.     fExonBlast->SetStatus(true);
  1528.     super->NextSubviewBelowLeft();
  1529.  
  1530.     (void) new DPrompt(0, super, "Region of known coding (start,end)");
  1531.     super->NextSubviewToRight();
  1532.     fCodeX= new DEditText(0,super,NULL,4);
  1533.     super->NextSubviewToRight();
  1534.     fCodeY= new DEditText(0,super,NULL,4);
  1535.     super->NextSubviewBelowLeft();
  1536.  
  1537.     (void) new DPrompt(0, super, "Coordinates of known first exon (start,end)");
  1538.     super->NextSubviewToRight();
  1539.     fFirstX= new DEditText(0,super,NULL,4);
  1540.     super->NextSubviewToRight();
  1541.     fFirstY= new DEditText(0,super,NULL,4);
  1542.     super->NextSubviewBelowLeft();
  1543.  
  1544.     (void) new DPrompt(0, super, "Coordinates of known last exon (start,end)");
  1545.     super->NextSubviewToRight();
  1546.     fLastX= new DEditText(0,super,NULL,4);
  1547.     super->NextSubviewToRight();
  1548.     fLastY= new DEditText(0,super,NULL,4);
  1549.     super->NextSubviewBelowLeft();
  1550.  
  1551.     (void) new DPrompt(0, super, "Region where splicing is blocked (start,end)");
  1552.     super->NextSubviewToRight();
  1553.     fAltX= new DEditText(0,super,NULL,4);
  1554.     super->NextSubviewToRight();
  1555.     fAltY= new DEditText(0,super,NULL,4);
  1556.     super->NextSubviewBelowLeft();
  1557.  
  1558.     super= this;
  1559.     
  1560.     (void) new DPrompt(0, super, "Your query sequence:");
  1561.     super->NextSubviewBelowLeft();
  1562.     DView *emsg= this->InstallMessage(super, fSeq->Bases());
  1563.     
  1564.     SetDlogItems( eto, efrom, eccopy, esubj, emsg);
  1565.     
  1566.     AddOkayCancelButtons(cSEND,"Send");
  1567.     this->NextSubviewToRight();
  1568.     DButton* hb= new DButton( cHelpButton, this, "Help");
  1569.     hb->SetResize( DView::fixed, DView::moveinsuper);
  1570.     
  1571.     DWindow::Open();
  1572. }
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583. // class DORNLGrail
  1584.  
  1585. // note: this method can handle multi-seq input -- fix later for fSeqList
  1586.  
  1587. char* DORNLGrail::kAddress = "GRAIL@ornl.gov";
  1588. char* DORNLGrail::kTitle = "Grail at ORNL";
  1589. #ifdef OS_DOS
  1590. char* DORNLGrail::kHelp     = "grail.hel";     
  1591. #else
  1592. char* DORNLGrail::kHelp     = "grail.help";     
  1593. #endif                                                                     
  1594.             
  1595.                                                                                 
  1596. DORNLGrail::DORNLGrail( long id, DTaskMaster* itsSuperior, DSequence* theSeq) :
  1597.     DSendMailDialog(id, itsSuperior,    -5,  -5,  -50,  -20, kTitle),
  1598.     fSeq(NULL)
  1599. {
  1600.     fSeq= (DSequence*) theSeq->Clone();
  1601. }
  1602.  
  1603. DORNLGrail::~DORNLGrail()
  1604. {
  1605.     if (fSeq) delete fSeq;
  1606. }
  1607.  
  1608. char* DORNLGrail::BuildMessage()
  1609. {
  1610.     char        buf[512];
  1611.     char        *msg = NULL;
  1612.     
  1613.             // want IOSTREAMS here !!!!!!!!!!!!!!!!!!!! not damn sprintf's
  1614.     DTempFile* qfile = new DTempFile();
  1615.  
  1616.     short nseq= 1; // fix later for SeqList input
  1617.      sprintf( buf, "Sequences %d", nseq);    qfile->WriteLine(buf);
  1618.  
  1619.     if (fGrail2->GetStatus()) { 
  1620.         sprintf( buf, " -2");    qfile->WriteLine(buf); 
  1621.         }
  1622.     if (fExon->GetStatus()) { 
  1623.         sprintf( buf, " -E");    qfile->WriteLine(buf); 
  1624.         }
  1625.  
  1626.      sprintf( buf, "\n");    qfile->WriteLine(buf);
  1627.  
  1628.     msg= fMsg->GetText();
  1629.     fSeq->SetBases( msg);
  1630.     MemFree(msg);
  1631.     DSeqFile::DontSaveMasks();
  1632.     fSeq->DoWrite( qfile, DSeqFile::kPearson); 
  1633.     DSeqFile::DoSaveMasks();
  1634.             
  1635.     ulong msgbytes;
  1636.     msg= qfile->ReadIntoMemory( msgbytes);
  1637.     delete qfile;
  1638.  
  1639.     return msg;
  1640. }
  1641.  
  1642.  
  1643.  
  1644. Boolean DORNLGrail::IsMyAction(DTaskMaster* action) 
  1645. {    
  1646.     switch(action->Id()) {
  1647.  
  1648.         case cHelpButton:
  1649.             gApplication->OpenHelp(kHelp);
  1650.             return true;            
  1651.          
  1652.         default:
  1653.             return DSendMailDialog::IsMyAction(action);    
  1654.         }
  1655. }
  1656.  
  1657.  
  1658.  
  1659. void DORNLGrail::Open()
  1660. {
  1661.     DView* super = this;
  1662.     DCluster* clu;
  1663.  
  1664.     char *shorthelp1= 
  1665. "GRAIL provides analysis of protein coding potential of a DNA sequence, and an option"LINEEND
  1666. "for protein sequence database search of putative coding regions.  The coding"LINEEND
  1667. "recognition portion of the system uses a neural network which combines a series of"LINEEND
  1668. "coding prediction algorithms.";
  1669.      
  1670.     SETNOTEFONT();
  1671.     (void) new DNotePanel(0,super,shorthelp1, 25*Nlm_stdCharWidth,0,gNoteFont);
  1672.     super->NextSubviewBelowLeft();
  1673.  
  1674.     DView *eto  = this->InstallTo(super, kAddress);
  1675.     DView *efrom= this->InstallFrom(super);  // don't have to display this one
  1676.     DView *esubj= NULL; 
  1677.     DView *eccopy= NULL;
  1678.  
  1679.     clu= new DCluster(0,super,0,0,false,"Options");
  1680.     super= clu;
  1681.  
  1682.     (void) new DPrompt(0, super, "Use Grail version 2");
  1683.     super->NextSubviewToRight();
  1684.     fGrail2= new DCheckBox(0,super, "");
  1685.     super->NextSubviewBelowLeft();
  1686.  
  1687.     (void) new DPrompt(0, super, "Compare found exon to protein database");
  1688.     super->NextSubviewToRight();
  1689.     fExon= new DCheckBox(0,super, "");
  1690.     super->NextSubviewBelowLeft();
  1691.  
  1692.     super= this;
  1693.     
  1694.     (void) new DPrompt(0, super, "Your query sequence:");
  1695.     super->NextSubviewBelowLeft();
  1696.     DView *emsg= this->InstallMessage(super, fSeq->Bases());
  1697.     
  1698.     SetDlogItems( eto, efrom, eccopy, esubj, emsg);
  1699.     
  1700.     AddOkayCancelButtons(cSEND,"Send");
  1701.     this->NextSubviewToRight();
  1702.     DButton* hb= new DButton( cHelpButton, this, "Help");
  1703.     hb->SetResize( DView::fixed, DView::moveinsuper);
  1704.     
  1705.     DWindow::Open();
  1706. }
  1707.  
  1708.